--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  R:\Current Research\Markets-Pridemore\Work\MAR06-PanelModels.log
  log type:  text
 opened on:  25 Jun 2024, 16:19:20

. 
. //  program:    Stata 
. //  task:       Panel Models 
. //  project:    Markets  
. 
. version
version 17.0

. clear all

. macro drop _all

. set linesize 80

. set more off

. local tag " 06-25-24| Cleaned 06-25-24"

. local file "MAR06-PanelModels"

. local note "|`tag' | `file'"

. local opt "noparen sideway excel noaster  bdec(2)  sdec(2)  pdec(3)   adec(2) 
> e(r2) stats(coef se pval)"

. local dv "lrhom"

. local iv "fraser"

. local iv2 "infantmort" 

. local cont "edu unemp  popdense perurban  sexratio"

. 
. //      #0
. //      Loading data 
. use MAR05-QuantModels.dta

. 
. //      #1
. //      Panel models 
. xtreg `dv' fraser `iv2' `cont', fe vce(cluster CID) 

Fixed-effects (within) regression               Number of obs     =      1,524
Group variable: CID                             Number of groups  =         88

R-squared:                                      Obs per group:
     Within  = 0.1294                                         min =          6
     Between = 0.3310                                         avg =       17.3
     Overall = 0.3199                                         max =         20

                                                F(7,87)           =      19.36
corr(u_i, Xb) = 0.2209                          Prob > F          =     0.0000

                                   (Std. err. adjusted for 88 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      fraser |  -.2445491   .0870008    -2.81   0.006    -.4174727   -.0716256
  infantmort |   .0044805   .0135865     0.33   0.742    -.0225242    .0314852
         edu |   -2.72643   .8136422    -3.35   0.001    -4.343632   -1.109228
       unemp |   .0035128    .008064     0.44   0.664    -.0125153     .019541
    popdense |  -.0003394   .0001028    -3.30   0.001    -.0005437   -.0001351
    perurban |   .0094687   .0227876     0.42   0.679    -.0358241    .0547615
    sexratio |  -.0122216      .0071    -1.72   0.089    -.0263336    .0018904
       _cons |   5.264567   1.806743     2.91   0.005     1.673471    8.855664
-------------+----------------------------------------------------------------
     sigma_u |  1.1500481
     sigma_e |  .41042354
         rho |  .88702822   (fraction of variance due to u_i)
------------------------------------------------------------------------------

.         outreg2 using `file'.dta, replace `opt' 
MAR06-PanelModels.xml
dir : seeout

. 
. foreach var in   heritage rol {
  2.         xtreg `dv' `var' `iv2' `cont', fe vce(cluster CID) 
  3.         outreg2 using `file'.dta, append `opt' 
  4.         }

Fixed-effects (within) regression               Number of obs     =      1,487
Group variable: CID                             Number of groups  =         87

R-squared:                                      Obs per group:
     Within  = 0.1223                                         min =          3
     Between = 0.3135                                         avg =       17.1
     Overall = 0.3014                                         max =         20

                                                F(7,86)           =      23.34
corr(u_i, Xb) = 0.1609                          Prob > F          =     0.0000

                                   (Std. err. adjusted for 87 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
    heritage |  -.0214634   .0057537    -3.73   0.000    -.0329014   -.0100253
  infantmort |   .0087281   .0136365     0.64   0.524    -.0183804    .0358367
         edu |  -2.549563   .8138502    -3.13   0.002    -4.167444   -.9316827
       unemp |   .0031722   .0084518     0.38   0.708    -.0136294    .0199738
    popdense |  -.0003789   .0000979    -3.87   0.000    -.0005736   -.0001843
    perurban |   .0066231   .0218997     0.30   0.763    -.0369119    .0501582
    sexratio |  -.0105191   .0066851    -1.57   0.119    -.0238087    .0027704
       _cons |   4.765402   1.548786     3.08   0.003     1.686517    7.844287
-------------+----------------------------------------------------------------
     sigma_u |   1.157435
     sigma_e |  .41311355
         rho |  .88700212   (fraction of variance due to u_i)
------------------------------------------------------------------------------
MAR06-PanelModels.xml
dir : seeout

Fixed-effects (within) regression               Number of obs     =      1,379
Group variable: CID                             Number of groups  =         88

R-squared:                                      Obs per group:
     Within  = 0.1166                                         min =          5
     Between = 0.3554                                         avg =       15.7
     Overall = 0.3826                                         max =         18

                                                F(7,87)           =      11.63
corr(u_i, Xb) = 0.0686                          Prob > F          =     0.0000

                                   (Std. err. adjusted for 88 clusters in CID)
------------------------------------------------------------------------------
             |               Robust
       lrhom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         rol |  -.4731735   .1598942    -2.96   0.004    -.7909806   -.1553665
  infantmort |   .0082058   .0144381     0.57   0.571    -.0204915    .0369032
         edu |  -3.233939    .844457    -3.83   0.000    -4.912389   -1.555489
       unemp |   .0027268   .0068372     0.40   0.691    -.0108628    .0163164
    popdense |  -.0002294   .0001205    -1.90   0.060    -.0004689    .0000101
    perurban |   .0078258   .0250416     0.31   0.755    -.0419471    .0575987
    sexratio |  -.0042898    .008352    -0.51   0.609    -.0208904    .0123108
       _cons |   3.354551   1.705776     1.97   0.052    -.0358625    6.744965
-------------+----------------------------------------------------------------
     sigma_u |  1.1169306
     sigma_e |  .40692167
         rho |  .88282287   (fraction of variance due to u_i)
------------------------------------------------------------------------------
MAR06-PanelModels.xml
dir : seeout

. 
. //      #2
. //      Panel models without 
. foreach var in fraser heritage rol {
  2.         xtreg `dv' `var' `iv2' `cont', fe 
  3.         outreg2 using `file'.dta, append `opt' 
  4.         }

Fixed-effects (within) regression               Number of obs     =      1,524
Group variable: CID                             Number of groups  =         88

R-squared:                                      Obs per group:
     Within  = 0.1294                                         min =          6
     Between = 0.3310                                         avg =       17.3
     Overall = 0.3199                                         max =         20

                                                F(7,1429)         =      30.33
corr(u_i, Xb) = 0.2209                          Prob > F          =     0.0000

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      fraser |  -.2445491   .0394059    -6.21   0.000    -.3218487   -.1672495
  infantmort |   .0044805   .0052488     0.85   0.393    -.0058158    .0147767
         edu |   -2.72643    .398004    -6.85   0.000    -3.507165   -1.945695
       unemp |   .0035128   .0043536     0.81   0.420    -.0050274     .012053
    popdense |  -.0003394   .0001272    -2.67   0.008    -.0005889   -.0000899
    perurban |   .0094687   .0066358     1.43   0.154    -.0035482    .0224856
    sexratio |  -.0122216   .0060164    -2.03   0.042    -.0240235   -.0004197
       _cons |   5.264567   .7676031     6.86   0.000     3.758818    6.770317
-------------+----------------------------------------------------------------
     sigma_u |  1.1500481
     sigma_e |  .41042354
         rho |  .88702822   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(87, 1429) = 102.16                  Prob > F = 0.0000
MAR06-PanelModels.xml
dir : seeout

Fixed-effects (within) regression               Number of obs     =      1,487
Group variable: CID                             Number of groups  =         87

R-squared:                                      Obs per group:
     Within  = 0.1223                                         min =          3
     Between = 0.3135                                         avg =       17.1
     Overall = 0.3014                                         max =         20

                                                F(7,1393)         =      27.74
corr(u_i, Xb) = 0.1609                          Prob > F          =     0.0000

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
    heritage |  -.0214634   .0036679    -5.85   0.000    -.0286586   -.0142681
  infantmort |   .0087281   .0052522     1.66   0.097     -.001575    .0190313
         edu |  -2.549563    .405557    -6.29   0.000    -3.345132   -1.753995
       unemp |   .0031722   .0045295     0.70   0.484    -.0057132    .0120576
    popdense |  -.0003789   .0001282    -2.96   0.003    -.0006304   -.0001275
    perurban |   .0066231   .0066878     0.99   0.322    -.0064961    .0197424
    sexratio |  -.0105191   .0060546    -1.74   0.083    -.0223962     .001358
       _cons |   4.765402   .7527633     6.33   0.000      3.28873    6.242074
-------------+----------------------------------------------------------------
     sigma_u |   1.157435
     sigma_e |  .41311355
         rho |  .88700212   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(86, 1393) = 103.14                  Prob > F = 0.0000
MAR06-PanelModels.xml
dir : seeout

Fixed-effects (within) regression               Number of obs     =      1,379
Group variable: CID                             Number of groups  =         88

R-squared:                                      Obs per group:
     Within  = 0.1166                                         min =          5
     Between = 0.3554                                         avg =       15.7
     Overall = 0.3826                                         max =         18

                                                F(7,1284)         =      24.22
corr(u_i, Xb) = 0.0686                          Prob > F          =     0.0000

------------------------------------------------------------------------------
       lrhom | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         rol |  -.4731735   .0764784    -6.19   0.000    -.6232098   -.3231372
  infantmort |   .0082058   .0060132     1.36   0.173    -.0035909    .0200025
         edu |  -3.233939   .4705966    -6.87   0.000    -4.157162   -2.310716
       unemp |   .0027268   .0046431     0.59   0.557    -.0063821    .0118358
    popdense |  -.0002294   .0001395    -1.64   0.100     -.000503    .0000443
    perurban |   .0078258   .0078572     1.00   0.319    -.0075885    .0232402
    sexratio |  -.0042898   .0063602    -0.67   0.500    -.0167673    .0081877
       _cons |   3.354551   .7858268     4.27   0.000     1.812906    4.896197
-------------+----------------------------------------------------------------
     sigma_u |  1.1169306
     sigma_e |  .40692167
         rho |  .88282287   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(87, 1284) = 86.17                   Prob > F = 0.0000
MAR06-PanelModels.xml
dir : seeout

. 
. //      #3
. //      save and close 
. save `file'.dta, replace 
file MAR06-PanelModels.dta saved

. log close 
      name:  <unnamed>
       log:  R:\Current Research\Markets-Pridemore\Work\MAR06-PanelModels.log
  log type:  text
 closed on:  25 Jun 2024, 16:19:33
--------------------------------------------------------------------------------
